<?php
class GonggaoModel extends Model{
    function save_gonggao($gg_title,$gg_date,$gg_body){
        $sql="insert into gonggao (gg_title,gg_date,gg_body) "
        ."values ('{$gg_title}',{$gg_date},'{$gg_body}')";
        return $this->execute($sql);
    }


    function get_gonggao($date){   //传递一个日期，获取大于这个日期的全部公告
        $sql="select * from gonggao where gg_date>={$date} order by gg_date";
        return $this->query($sql);
        
    }

    function get_gg($id){
        //根据公告的ID获取公告的内容等信息
        $sql="select * from gonggao where gg_id={$id}";
        return $this->query($sql);

    }
}

?>
